﻿#pragma once

#include <gtkmm/applicationwindow.h>
#include <gtkmm/builder.h>
#include <gtkmm/headerbar.h>
#include <gtkmm/cssprovider.h>

#include "EventButton.hpp"
#include "EventEntryBox.hpp"
#include "GroupEntry.hpp"
#include "EventEntry.hpp"

namespace Event
{

class ApplicationWindow : public Gtk::ApplicationWindow
{
public:
    ApplicationWindow(BaseObjectType *cobject,
        const Glib::RefPtr<Gtk::Builder> &refBuilder);
    ~ApplicationWindow(void);

    static Event::ApplicationWindow *create();
    static void on_parsing_error(const Glib::RefPtr<const Gtk::CssSection> &section,
        const Glib::Error &error);

    /* Add GroupEntry to SideBar */
    void append_group_entry(Event::GroupEntry &entry);
    /* Add EventEntry to MainWindow */
    void append_event_entry(Event::EventEntry &entry);

protected:
    Glib::RefPtr<Gtk::Builder> m_refBuilder;

private:
    /* 默认样式表 */
    Glib::RefPtr<Gtk::CssProvider> m_refCssProvider;
    Gtk::HeaderBar *header_bar;
    Event::Button *add_event_button;
    /* 主页面的 GroupsBox 和 EventsBox */
    Event::EntryBox *groups_box;
    Event::EntryBox *events_box;
};

} // namespace Event
